package demo01;

import java.io.UnsupportedEncodingException;

public class EncodingDemo {
    public static void main(String[] args) {
        String originalStr = "五未";
        String encodedStr = "";

        try {
            byte[] bytes = originalStr.getBytes("GBK");
            encodedStr = new String(bytes, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }

        System.out.println("转码前: " + originalStr);
        System.out.println("转码后: " + encodedStr);
    }
}